import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/pages/Home/Home'

function lazyLoadPage(pageName){
	return () => import(`@/pages/${pageName}/${pageName}`);
}

Vue.use(Router)

export default new Router({
	routes: [
		// 首页
		{
			path: '/',
			name: 'Home',
			component: Home,
			meta: {
				first: true,
				keep: true,
				title: '首页'
			}
		},
		// 详情
		{
			path: '/DetailShow',
			name: 'DetailShow',
			component: lazyLoadPage('DetailShow'),
			meta: {
				first: false,
				keep: true,
				title: '详情'
			}
		}
	]
})
